home *** CD-ROM | disk | FTP | other *** search
- function setStartScreen()
- {
- header_op.textColor = _root.parseColor(_root.submenu_header_color);
- header_op.text = _root.directory_label;
- subheader_op.textColor = _root.parseColor(_root.submenu_subheader_color);
- subheader_op.text = _root.directory_desc;
- setRGB(header_line_mc,_root.parseColor(_root.seperator_line_color));
- header_line_mc._alpha = Number(_root.seperator_line_alpha);
- }
- function renderContent()
- {
- content_mc._visible = false;
- removeContent();
- entry_counter = 0;
- y_pos = y_start_pos;
- renderContentElements(_root.cd_content.firstChild.childNodes,[0],7,"1");
- }
- function renderContentElements(nodes_array, depth_array, x_pos, full_version)
- {
- var _loc3_ = 0;
- while(_loc3_ < nodes_array.length)
- {
- depth_array[depth_array.length - 1] += 1;
- var _loc2_ = undefined;
- if(depth_array.length <= 1)
- {
- _loc2_ = content_mc.attachMovie("entry_mc","entry_mc" + entry_counter,content_mc.getNextHighestDepth());
- _loc2_.main = true;
- if(_loc3_ > 0)
- {
- y_pos += main_entry_y_dis;
- }
- }
- else
- {
- _loc2_ = content_mc.attachMovie("sub_entry_mc","entry_mc" + entry_counter,content_mc.getNextHighestDepth());
- }
- _loc2_._x = 0;
- _loc2_._y = y_pos;
- _loc2_.id = entry_counter;
- entry_counter++;
- _loc2_.node_type = nodes_array[_loc3_].attributes.type;
- _loc2_.entry_name = nodes_array[_loc3_].attributes.name;
- if(nodes_array[_loc3_].attributes.cd == "0" || full_version == "0")
- {
- if(nodes_array[_loc3_].attributes.cd == "0")
- {
- _loc2_.entry_name += " (" + _root.demo_only_sentence + ")";
- }
- _loc2_._alpha = 50;
- _loc2_.bg_mc._visible = false;
- _loc2_.enabled = false;
- _loc2_.video_progress_mc._visible = false;
- }
- _loc2_.teaser = nodes_array[_loc3_].attributes.teaser;
- if(nodes_array[_loc3_].attributes.length != "" && nodes_array[_loc3_].attributes.length != undefined)
- {
- if(_loc2_.node_type == "menu")
- {
- _loc2_.teaser += "\n\n" + _root.total_duration_desc + ": " + nodes_array[_loc3_].attributes.length;
- }
- else
- {
- _loc2_.teaser += "\n\n" + _root.duration_desc + ": " + nodes_array[_loc3_].attributes.length;
- }
- }
- _loc2_.image = nodes_array[_loc3_].attributes.image;
- _loc2_.movie = nodes_array[_loc3_].attributes.movie;
- _loc2_.movie_name = nodes_array[_loc3_].attributes.movie.split(".")[0];
- _loc2_.chapter_id = nodes_array[_loc3_].attributes.index;
- _loc2_.movie_length = nodes_array[_loc3_].attributes.length;
- _loc2_.chapter_op._x = x_pos;
- setRGB(_loc2_.bg_mc,_root.parseColor(_root.submenu_rollover_color));
- _loc2_.bg_mc._alpha = Number(_root.submenu_rollover_alpha);
- _loc2_.bg_mc._visible = false;
- _loc2_.chapter_op.autoSize = true;
- _loc2_.chapter_op.textColor = _root.parseColor(_root.index_color);
- _loc2_.chapter_op.text = nodes_array[_loc3_].attributes.index;
- _loc2_.text_op.multiline = true;
- _loc2_.text_op.wordWrap = true;
- _loc2_.text_op.autoSize = true;
- _loc2_.text_op._x = Math.round(_loc2_.chapter_op._x + Math.max(_loc2_.chapter_op.textWidth,30) + 5);
- _loc2_.text_op.textColor = _root.parseColor(_root.submenu_color);
- _loc2_.text_op.text = _loc2_.entry_name;
- _loc2_.time_op.textColor = _root.parseColor(_root.submenu_color);
- if(_loc2_.node_type == "movie")
- {
- _loc2_.time_op.text = nodes_array[_loc3_].attributes.length;
- var _loc8_ = nodes_array[_loc3_].attributes.length.split(":");
- var _loc5_ = Number(_loc8_[0]) * 60 + Number(_loc8_[1]);
- if(isNaN(_loc5_))
- {
- _loc5_ = 0;
- }
- _loc2_.total_time = _loc5_;
- }
- else
- {
- _loc2_.time_op.text = "";
- }
- if(_loc2_.node_type == "movie")
- {
- _loc2_.symbol_mc.attachMovie("play_icon_mc","icon_mc",1);
- }
- else if(_loc2_.node_type == "menu")
- {
- _loc2_.bg_mc.useHandCursor = false;
- }
- else if(_loc2_.node_type == "toolbar")
- {
- _loc2_.symbol_mc.attachMovie("toolbar_icon_mc","icon_mc",1);
- }
- else if(_loc2_.node_type == "toolbar_advanced")
- {
- _loc2_.symbol_mc.attachMovie("toolbar_icon_mc","icon_mc",1);
- }
- else if(_loc2_.node_type == "mct")
- {
- _loc2_.symbol_mc.attachMovie("mct_icon_mc","icon_mc",1);
- }
- else if(_loc2_.node_type == "summary")
- {
- _loc2_.symbol_mc.attachMovie("summary_icon_mc","icon_mc",1);
- }
- _loc2_.symbol_mc.icon_mc._width = 16;
- _loc2_.symbol_mc.icon_mc._height = 16;
- _loc2_.onRelease = entryOnClick;
- _loc2_.onRollOver = _loc2_.onDragOver = entryOnRollOver;
- _loc2_.onRollOut = _loc2_.onDragOut = entryOnRollOut;
- setItemSize(_loc2_);
- setRGB(_loc2_.video_progress_mc.progress_bar_mc,_root.parseColor(_root.directory_progress_bar_seen_color));
- setRGB(_loc2_.video_progress_mc.total_bar_mc,_root.parseColor(_root.directory_progress_bar_total_color));
- setVideoProgress(_loc2_);
- y_pos += Math.round(_loc2_._height + entry_y_dis);
- if(nodes_array[_loc3_].hasChildNodes())
- {
- var _loc7_ = nodes_array[_loc3_].attributes.cd;
- if(full_version == "0")
- {
- _loc7_ = "0";
- }
- renderContentElements(nodes_array[_loc3_].childNodes,depth_array.concat([0]),_loc2_.text_op._x,_loc7_);
- }
- _loc3_ = _loc3_ + 1;
- }
- if(depth_array.length == 1)
- {
- content_mc.attachMovie("place_holder_mc","place_holder_mc",content_mc.getNextHighestDepth());
- content_mc.place_holder_mc._y = y_pos;
- content_mc._visible = true;
- mc_scroller.targetWidth = Math.round(content_mc._width);
- mc_scroller.targetHeight = Math.round(content_mc._height);
- }
- content_mc.cacheAsBitmap = true;
- }
- function setVideoProgress(entry)
- {
- if(entry.node_type == "movie")
- {
- if(!isNaN(v2b_so.data[entry.movie_name + "_data"].seen_time))
- {
- var _loc3_ = v2b_so.data[entry.movie_name + "_data"].seen_time;
- var _loc4_ = entry.total_time;
- var _loc1_ = Math.round(100 * _loc3_ / _loc4_);
- if(_loc1_ < 0 || isNaN(_loc1_))
- {
- _loc1_ = 0;
- }
- else if(_loc1_ > 100)
- {
- _loc1_ = 100;
- }
- entry.video_progress_mc.progress_bar_mc._xscale = _loc1_;
- }
- else
- {
- entry.video_progress_mc.progress_bar_mc._xscale = 0;
- }
- }
- else
- {
- entry.video_progress_mc._visible = false;
- }
- }
- function reRenderVideoProgress()
- {
- var _loc1_ = 0;
- while(_loc1_ < entry_counter)
- {
- var _loc2_ = content_mc["entry_mc" + _loc1_];
- setVideoProgress(_loc2_);
- _loc1_ = _loc1_ + 1;
- }
- }
- function setItemSize(item_mc)
- {
- item_mc.bg_mc._width = max_content_width;
- item_mc.symbol_mc._x = max_content_width - 25;
- item_mc.time_op._x = item_mc.symbol_mc._x - 70;
- item_mc.video_progress_mc._x = max_content_width - 130;
- item_mc.text_op._width = item_mc.video_progress_mc._x - 25 - item_mc.text_op._x;
- if(item_mc.main)
- {
- item_mc.bg_mc._height = Math.round(item_mc.text_op._y + item_mc.text_op.textHeight + 4);
- }
- else
- {
- item_mc.bg_mc._height = Math.round(item_mc.text_op._y + item_mc.text_op.textHeight + 4);
- }
- }
- function entryOnClick()
- {
- if(this.node_type == "movie")
- {
- startVideo(this.entry_name,this.movie,this.chapter_id);
- }
- else if(this.node_type == "toolbar")
- {
- local_root_mc._parent._parent.__lastactive.menu_item_rollover_mc._alpha = 0;
- local_root_mc._parent._parent.__lastactive.__active = false;
- local_root_mc._parent._parent.renderToolbar(this.movie,this.teaser,this.chapter_id,this.entry_name,true);
- }
- else if(this.node_type == "toolbar_advanced")
- {
- local_root_mc._parent._parent.__lastactive.menu_item_rollover_mc._alpha = 0;
- local_root_mc._parent._parent.__lastactive.__active = false;
- local_root_mc._parent._parent.renderAdvancedToolbar(this.movie,this.teaser,this.chapter_id,this.entry_name,true);
- }
- else if(this.node_type == "mct")
- {
- _root.renderMCT(this.movie);
- }
- else if(this.node_type == "summary")
- {
- local_root_mc._parent._parent.__lastactive.menu_item_rollover_mc._alpha = 0;
- local_root_mc._parent._parent.__lastactive.__active = false;
- local_root_mc._parent._parent.renderSummary(this.movie,this.teaser,this.chapter_id,this.entry_name,true);
- }
- }
- function entryOnRollOver()
- {
- roll_over_id = this.id;
- this.bg_mc._visible = true;
- this.text_op.textColor = _root.parseColor(_root.submenu_rollover_color);
- this.time_op.textColor = _root.parseColor(_root.submenu_rollover_color);
- var _loc3_ = {x:this.symbol_mc._x - 4,y:0};
- this.localToGlobal(_loc3_);
- local_root_mc.globalToLocal(_loc3_);
- if(this.node_type == "movie")
- {
- _root.toolTip(_root.movie_tooltip,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
- }
- else if(this.node_type != "menu")
- {
- if(this.node_type == "toolbar")
- {
- _root.toolTip(_root.toolbar_tooltip,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
- }
- else if(this.node_type == "mct")
- {
- _root.toolTip(_root.mct_tooltip,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
- }
- else if(this.node_type == "summary")
- {
- _root.toolTip(_root.summary_tooltip,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
- }
- }
- teaser_delay = setTimeout(local_root_mc._parent._parent,"renderTeaser",teaser_timeout,this.entry_name,this.teaser,this.chapter_id,this.image);
- }
- function entryOnRollOut()
- {
- _root.killToolTip();
- clearInterval(teaser_delay);
- local_root_mc._parent._parent.destroyTeaser();
- this.bg_mc._visible = false;
- this.text_op.textColor = _root.parseColor(_root.submenu_color);
- this.time_op.textColor = _root.parseColor(_root.submenu_color);
- this.date_op.textColor = _root.parseColor(_root.submenu_color);
- }
- function startVideo(movie_name, movie, chapter)
- {
- var _loc3_ = chapter.split(".");
- if(_loc3_.length > 0 && isNaN(Number(_loc3_[_loc3_.length - 1])))
- {
- _loc3_.splice(_loc3_.length - 1,1);
- }
- var _loc4_ = _root.cd_content.firstChild;
- if(_loc3_.length > 1)
- {
- var _loc2_ = 0;
- while(_loc2_ < _loc3_.length - 1)
- {
- _loc4_ = _loc4_.childNodes[_loc3_[_loc2_] - 1];
- _loc2_ = _loc2_ + 1;
- }
- }
- _root.renderVideoBookmark(_loc4_,movie,movie_name,undefined);
- }
- function removeContent()
- {
- for(var _loc1_ in content_mc)
- {
- content_mc[_loc1_].removeMovieClip();
- }
- }
- function navigationButton_onRollOver()
- {
- this.btn_rollover_mc._alpha = 100;
- }
- function navigationButton_onRollOut()
- {
- this.btn_rollover_mc._alpha = 0;
- }
- function setVisibility(value)
- {
- if(value)
- {
- reRenderVideoProgress();
- Mouse.removeListener(ftScrollBarMouseListener);
- Mouse.addListener(ftScrollBarMouseListener);
- this._visible = value;
- if(local_setpos_changelog != _root.setpos_changelog)
- {
- mc_scroller._visible = false;
- setLocalPos();
- init_scroller_delay = setTimeout(setScrollerVisible,250);
- }
- }
- else
- {
- Mouse.removeListener(ftScrollBarMouseListener);
- this._visible = value;
- }
- }
- function setLocalPos()
- {
- if(local_root_mc._visible)
- {
- if(local_test)
- {
- parent_container_width = Stage.width;
- parent_container_height = Stage.height;
- }
- else
- {
- parent_container_width = _root.content_pos_mc.content_panel_mc._width - 535;
- parent_container_height = _root.content_pos_mc.content_panel_mc._height;
- }
- max_content_width = Math.floor(parent_container_width - 40);
- visible_scroller_height = Math.floor(parent_container_height - mc_scroller._y);
- mc_scroller.viewAreaWidth = parent_container_width - 36;
- mc_scroller.viewAreaHeight = Math.floor(visible_scroller_height);
- mc_scroller._x = parent_container_width - 16;
- mc_scroller.setSize(15,visible_scroller_height - 1);
- header_op._width = parent_container_width - 2 * header_op._x;
- subheader_op._width = header_op._width;
- header_line_mc._width = parent_container_width - 2 * header_line_mc._x;
- clearInterval(item_pos_delay);
- item_pos_delay = setTimeout(setItemPos,200);
- local_setpos_changelog = _root.setpos_changelog;
- }
- }
- function updateScroller()
- {
- if(visible_scroller_height < content_mc._height || mc_scroller.visible)
- {
- mc_scroller.setSize(15,visible_scroller_height - 1);
- }
- clearInterval(update_scroller_delay);
- }
- function setItemPos()
- {
- var _loc3_ = y_start_pos;
- var _loc4_ = content_mc.cacheAsBitmap;
- content_mc.cacheAsBitmap = false;
- var _loc2_ = 0;
- while(_loc2_ < entry_counter)
- {
- var _loc1_ = content_mc["entry_mc" + _loc2_];
- setItemSize(_loc1_);
- if(_loc1_.main && _loc2_ > 0)
- {
- _loc3_ += main_entry_y_dis;
- }
- _loc1_._y = _loc3_;
- _loc3_ += Math.round(_loc1_._height + entry_y_dis);
- _loc2_ = _loc2_ + 1;
- }
- content_mc.place_holder_mc._y = _loc3_;
- content_mc.cacheAsBitmap = _loc4_;
- mc_scroller.targetWidth = Math.round(content_mc._width);
- mc_scroller.targetHeight = Math.round(content_mc._height);
- }
- function createDateString(_date)
- {
- var _loc1_ = "";
- if(_date.getDate() >= 10)
- {
- _loc1_ += String(_date.getDate()) + ".";
- }
- else
- {
- _loc1_ += "0" + String(_date.getDate()) + ".";
- }
- if(_date.getMonth() >= 10)
- {
- _loc1_ += String(_date.getMonth()) + ".";
- }
- else
- {
- _loc1_ += "0" + String(_date.getMonth()) + ".";
- }
- _loc1_ += String(_date.getFullYear());
- return _loc1_;
- }
- function createTimeString(_sec)
- {
- var _loc1_ = "";
- var _loc2_ = Math.floor(_sec / 60);
- var _loc3_ = _sec - _loc2_ * 60;
- if(_loc2_ >= 10)
- {
- _loc1_ += String(_loc2_) + ":";
- }
- else
- {
- _loc1_ += "0" + String(_loc2_) + ":";
- }
- if(_loc3_ >= 10)
- {
- _loc1_ += String(_loc3_);
- }
- else
- {
- _loc1_ += "0" + String(_loc3_);
- }
- return _loc1_;
- }
- function setRGB(mc, color)
- {
- var _loc1_ = new flash.geom.ColorTransform();
- _loc1_.rgb = color;
- var _loc2_ = new flash.geom.Transform(mc);
- _loc2_.colorTransform = _loc1_;
- }
- function setScrollerVisible()
- {
- mc_scroller._visible = true;
- clearInterval(init_scroller_delay);
- }
- function setTextScoller()
- {
- info_mc.text_scroller.enabled = true;
- info_mc.text_scroller._visible = true;
- info_mc.text_scroller._x = info_mc.bm_text_bg_mc._x + info_mc.bm_text_bg_mc._width - 16;
- info_mc.text_scroller._y = info_mc.bm_text_bg_mc._y + 2;
- }
- var local_root_mc = this;
- var local_test = false;
- var contPath = "config/content.xml";
- var roll_over_id = -1;
- var local_setpos_changelog = -1;
- var entry_counter;
- var y_start_pos = 27;
- var entry_y_dis = 3;
- var main_entry_y_dis = 22;
- var parent_container_width = 1025;
- var parent_container_heigt = 626;
- var max_content_width = 720;
- var teaser_delay;
- var update_scroller_delay;
- var init_scroller_delay;
- var teaser_timeout = 250;
- var ftScrollBarMouseListener = new Object();
- var visible_scroller_height;
- var masterPanelListener = new Object();
- var v2b_so = SharedObject.getLocal(_root.so_name,"/");
- mc_scroller._visible = false;
- var y_pos = y_start_pos;
- ftScrollBarMouseListener.onMouseWheel = function(delta, scrollTarget)
- {
- if(local_root_mc._visible && mc_scroller.enabled)
- {
- if(mc_scroller.oSipDWs.hitTest(_root._xmouse,_root._ymouse,false))
- {
- var _loc3_ = Math.floor(parent_container_height - mc_scroller._y);
- var _loc2_ = Math.ceil(2500 / (content_mc._height - _loc3_));
- if(_loc2_ > 0)
- {
- if(delta < 1)
- {
- mc_scroller.scrollPercentage = Math.min(100,mc_scroller.scrollPercentage + _loc2_);
- }
- else
- {
- mc_scroller.scrollPercentage = Math.max(0,mc_scroller.scrollPercentage - _loc2_);
- }
- }
- }
- }
- };
- Mouse.addListener(ftScrollBarMouseListener);
-